<?php
/** @var EdadesController $this */
/** @var Edades $model */
/**
 * Permite administrar una lista del modelo Edades */
if (Yii::app()->user->checkAccess("admin")):
    $this->menu = array(
        array('label' => Yii::t('AweCrud.app', 'Create'), 'icon' => 'list-alt', 'url' => array('create')),
    );
endif;
?>
<div class="row-fluid">
    <div class="span10 ">
        <?php
        $this->beginWidget('zii.widgets.CPortlet', array(
            'title' => Yii::t('AweCrud.app', 'Manage') . ' ' . Edades::label(2),
        ));
        ?>

        <div class="well">
            <?php
            $this->widget('bootstrap.widgets.TbGridView', array(
                'id' => 'edades-grid',
                'type' => 'striped condensed',
                'dataProvider' => $model->search(),
                'filter' => $model,
                'columns' => array(
                    'descripcion',
                    'tiempo',
                    array(
                        'class' => 'CButtonColumn',
                        'template' => ' {view} {update} {delete}',
                        'buttons' => array(
                            'view' => array('label' => '<button class="btn btn-info"><i class="icon-eye-open"></i></button>',
                                'options' => array(
                                    'title' => Yii::t('AweCrud.app', 'Ver'),
                                ),
                                'type' => 'raw',
                                'imageUrl' => false,
                            ),
                            'delete' => array('label' => '<button class="btn btn-warning"><i class="icon-trash"></i></button>',
                                'options' => array(
                                    'title' => Yii::t('AweCrud.app', 'Eliminar'),
                                ),
                                'type' => 'raw',
                                'visible' => Yii::app()->user->checkAccess("admin") ? 'true' : 'false',
                                'imageUrl' => false,
                            ),
                            'update' => array('label' => '<button class="btn btn-success"><i class="icon-pencil"></i></button>',
                                'options' => array(
                                    'title' => Yii::t('AweCrud.app', 'Actualizar'),
                                ),
                                'type' => 'raw',
                                'visible' => Yii::app()->user->checkAccess("admin") ? 'true' : 'false',
                                'imageUrl' => false,
                            ),
                        ),
                        'htmlOptions' => array(
                            'width' => Yii::app()->user->checkAccess("admin") ? '140' : Yii::app()->user->checkAccess("supervisor") ? '95' : '20',
                        ),
                    ),
                ),
            ));
            ?>
            <?php $this->endWidget(); ?>
        </div>
    </div>

    <div class="span2">
        <?php
        $this->beginWidget('zii.widgets.CPortlet', array(
            'title' => Yii::t('AweCrud.app', 'Operaciones'),
        ));
        $this->widget('zii.widgets.CMenu', array(
            'items' => $this->menu,
            'htmlOptions' => array('class' => 'operations'),
        ));
        ?>
        <?php $this->endWidget(); ?>
    </div>
</div>